// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.enums;

/**
 * 论坛积分关联业务枚举
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2023-02-13
 */
public enum BarPointBusinessEnum {
    SIGN_IN(1, "签到", 2),
    POST_COMMON(2, "普通贴", 20),
    POST_FINE(3, "精品贴", 200),
    COMMENT(4, "评论", 5),
    SYSTEM_GIFT(5, "系统赠送", 0),
    LUCK_GIFT(6, "活动获得", 0),
    BUTLER_POST(11, "学习中心发帖", 0),
    BUTLER_COMMENT(12, "学习中心评论", 0);

    private int value;

    private String name;

    private int pointNum;

    BarPointBusinessEnum(int value, String name, int pointNum) {
        this.value = value;
        this.name = name;
        this.pointNum = pointNum;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public int getPointNum() {
        return pointNum;
    }

    public static String getNameByValue(int value) {
        BarPointBusinessEnum arrObj[] = BarPointBusinessEnum.values();
        for (BarPointBusinessEnum obj : arrObj) {
            if (value == obj.getValue()) {
                return obj.getName();
            }
        }
        return " ";
    }

    public static int getDefaultPointByValue(int value) {
        BarPointBusinessEnum arrObj[] = BarPointBusinessEnum.values();
        for (BarPointBusinessEnum obj : arrObj) {
            if (value == obj.getValue()) {
                return obj.getPointNum();
            }
        }
        return 0;
    }
}
